using System;

namespace Genko.Model.Schema
{
	public class DataType : ClassType
	{
        private string valueSeparator = null;
		private string inputRegex = null;
	
		protected internal DataType()
		{

		}

		protected internal DataType(MetaModel metaModel)
			: base(metaModel)
		{
			
		}

		public override string TagName
		{
			get
			{
				return SchemaTags.DataTypeTag;
			}
		}

        public override bool CanBeAttached(Member member)
        {
            return base.CanBeAttached(member);
        }

        [MemberAttribute]
        public virtual string ValueSeparator
        {
            get { return valueSeparator; }
            protected internal set { valueSeparator = value; }
        }
		
		[MemberAttribute]
		public virtual string InputRegex
		{
			get { return inputRegex; }
			protected internal set { inputRegex = value; }
		}

		public override ObjectMember CreateInstance()
		{
			return this.CreateInstance(typeof(ValueObject));
		}

		public virtual ValueObject CreateValueObject()
		{
			return null;
		}

		public static ValueObject CreateValueObject(Type type)
		{
			return null;
		}

		public virtual object Convert(Type target, ValueObject value)
		{
			return null;
		}
		
		public virtual bool IsValidObject(object value)
		{
			return false;
		}
		
		public virtual object Parse(string value)
		{
			return value;
		}
		
		public virtual string Serialize(object value)
		{
			return value.ToString();
		}
		
		public virtual object GetValueObject(object value)
		{
			return value;
		}
		
		public virtual object SetValueObject(object value)
		{
			return value;
		}
	}
}
